#include "stdafx.h"
#include "AeroKill.h"

#include <windows.h>

#define DE
#include "..\\..\\STD.h"
#include "..\\..\\Proc.h"

int WINAPI KillCmd(PROCESSENTRY32 Proc, PVOID Para)
{
	DWORD DwmID = (DWORD)Para;

	if ( Proc.th32ParentProcessID == DwmID ) //&&EQ(L"conhost.exe",Proc.szExeFile)
	{
		GrantPrivilege();

		KillProc(Proc.th32ProcessID);

		return 1;
	}

	return 0;
}

int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
	_In_opt_ HINSTANCE hPrevInstance,
	_In_ LPTSTR    lpCmdLine,
	_In_ int       nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

	DWORD DwmId = GetProcessID(L"Dwm.exe");

	EachProc(KillCmd, (PVOID)DwmId);

	return 0;
}
